#ifndef IMAGESLOADTHREAD_H
#define IMAGESLOADTHREAD_H

#include <QtCore/QThread>
#include <QtCore/QString>
#include <QtCore/QSize>
#include <QtGui/QImage>
#include "Portability.h"

class ImagesLoadThread : public QThread
{
	Q_OBJECT

public:
	ImagesLoadThread(QObject *parent=0);
	virtual ~ImagesLoadThread();

	void startLoad(const QString& file,const QSize&);
	void cancelAllLoading();

signals:
	void imageLoaded(const QImage& image,const QString& filePath);
private:
	virtual void run() override;	

	void emitImageLoaded(const QImage& image,const QString& filePath);
	friend class ImageLoader;

	ImageLoader* _imageLoader;
};

#endif // IMAGESLOADTHREAD_H
